<?php
class EPMenuDefaultCssProcessor extends EPMenuProcessor{
	public $itemCss='menuitem';
	public $linkCss='menulink';
	public $subMenuCss='submenu';
	public $topMenuCss='topmenu';
	public $itemWithsubMenuCss='subparent';


	public function afterParse($menuList){

	}

	public function beforeRender($menuList){
		$menuList->addMenuCss($this->topMenuCss);
		$this->processListRecursive($menuList);
	}

	public function afterRender($menuList){

	}

	private function processListRecursive($menuList){
		$menuItems=$menuList->getMenuItems();
		foreach($menuItems as $menuItem){
			$menuItem->addItemCss($this->itemCss);
			$menuItem->addLinkCss($this->linkCss);
			if($menuItem->hasSubMenu()){
				$submenu=$menuItem->getSubMenu();
				$submenu->addMenuCss($this->subMenuCss);
				$this->processListRecursive($submenu);
				$menuItem->addItemCss($this->itemWithsubMenuCss);
			}
		}
	}
}